﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bonobo.Irc.Client
{
    public class IrcClientSession : IDisposable
    {
        private IrcClientConnection _connection;

        public IrcClientSession(Uri uri)
        {
            _connection = new IrcClientConnection(uri);
            _connection.StateChanged += OnConnectionStateChanged;
        }

        public void OpenAsync()
        {
            _connection.OpenAsync();
        }

        public void CloseAsync()
        {
            if (_connection.State == IrcConnectionState.Opened)
            {
                _connection.SendAsync(new IrcMessage(null, IrcProtocol.req
            }
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }

        private void OnConnectionStateChanged(Object sender, IrcConnectionStateEventArgs e)
        {
            if (e.State == IrcConnectionState.Opened)
            {
            }
        }
    }
}
